package o;

import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.widget.OverScroller;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.core.view.ViewCompat;
import java.util.Arrays;

public class jf {
    private static final Interpolator ʽॱ = new Interpolator() {
        public float getInterpolation(float f) {
            float f2 = f - 1.0f;
            return (f2 * (((f2 * f2) * f2) * f2)) + 1.0f;
        }
    };
    private int[] ʻ;
    private boolean ʻॱ;
    private int[] ʼ;
    private final Runnable ʼॱ = new Runnable(this) {
        final /* synthetic */ jf ˎ;

        {
            this.ˎ = r1;
        }

        public void run() {
            this.ˎ.ˏ(0);
        }
    };
    private float[] ʽ;
    private final ViewGroup ʾ;
    private float[] ˊ;
    private float ˊॱ;
    private int ˋ = -1;
    private int ˋॱ;
    private int ˎ;
    private int ˏ;
    private VelocityTracker ˏॱ;
    private int ͺ;
    private float[] ॱ;
    private float ॱˊ;
    private View ॱˋ;
    private final e ॱˎ;
    private int[] ॱॱ;
    private OverScroller ॱᐝ;
    private float[] ᐝ;
    private int ᐝॱ;

    public static abstract class e {
        public abstract boolean ˏ(@NonNull View view, int i);

        public void ˏ(int i) {
        }

        public void ॱ(@NonNull View view, int i, int i2, @Px int i3, @Px int i4) {
        }

        public void ˊ(@NonNull View view, int i) {
        }

        public void ˎ(@NonNull View view, float f, float f2) {
        }

        public void ˎ(int i, int i2) {
        }

        public boolean ˋ(int i) {
            return false;
        }

        public void ˏ(int i, int i2) {
        }

        public int ॱ(int i) {
            return i;
        }

        public int ˊ(@NonNull View view) {
            return 0;
        }

        public int ˎ(@NonNull View view) {
            return 0;
        }

        public int ˎ(@NonNull View view, int i, int i2) {
            return 0;
        }

        public int ˋ(@NonNull View view, int i, int i2) {
            return 0;
        }
    }

    public static jf ˋ(@NonNull ViewGroup viewGroup, @NonNull e eVar) {
        return new jf(viewGroup.getContext(), viewGroup, eVar);
    }

    public static jf ˊ(@NonNull ViewGroup viewGroup, float f, @NonNull e eVar) {
        jf ˋ = ˋ(viewGroup, eVar);
        ˋ.ˏ = (int) (((float) ˋ.ˏ) * (1.0f / f));
        return ˋ;
    }

    private jf(@NonNull Context context, @NonNull ViewGroup viewGroup, @NonNull e eVar) {
        if (viewGroup == null) {
            throw new IllegalArgumentException("Parent view may not be null");
        } else if (eVar == null) {
            throw new IllegalArgumentException("Callback may not be null");
        } else {
            this.ʾ = viewGroup;
            this.ॱˎ = eVar;
            ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
            this.ˋॱ = (int) ((context.getResources().getDisplayMetrics().density * 20.0f) + 0.5f);
            this.ˏ = viewConfiguration.getScaledTouchSlop();
            this.ˊॱ = (float) viewConfiguration.getScaledMaximumFlingVelocity();
            this.ॱˊ = (float) viewConfiguration.getScaledMinimumFlingVelocity();
            this.ॱᐝ = new OverScroller(context, ʽॱ);
        }
    }

    public void ॱ(float f) {
        this.ॱˊ = f;
    }

    public int ॱ() {
        return this.ˎ;
    }

    public void ˋ(int i) {
        this.ᐝॱ = i;
    }

    @Px
    public int ˊ() {
        return this.ˋॱ;
    }

    public void ॱ(@NonNull View view, int i) {
        if (view.getParent() != this.ʾ) {
            throw new IllegalArgumentException("captureChildView: parameter must be a descendant of the ViewDragHelper's tracked parent view (" + this.ʾ + ")");
        }
        this.ॱˋ = view;
        this.ˋ = i;
        this.ॱˎ.ˊ(view, i);
        ˏ(1);
    }

    @Nullable
    public View ˎ() {
        return this.ॱˋ;
    }

    @Px
    public int ˏ() {
        return this.ˏ;
    }

    public void ˋ() {
        this.ˋ = -1;
        ᐝ();
        if (this.ˏॱ != null) {
            this.ˏॱ.recycle();
            this.ˏॱ = null;
        }
    }

    public void ʻ() {
        ˋ();
        if (this.ˎ == 2) {
            int currX = this.ॱᐝ.getCurrX();
            int currY = this.ॱᐝ.getCurrY();
            this.ॱᐝ.abortAnimation();
            int currX2 = this.ॱᐝ.getCurrX();
            int currY2 = this.ॱᐝ.getCurrY();
            this.ॱˎ.ॱ(this.ॱˋ, currX2, currY2, currX2 - currX, currY2 - currY);
        }
        ˏ(0);
    }

    public boolean ॱ(@NonNull View view, int i, int i2) {
        this.ॱˋ = view;
        this.ˋ = -1;
        boolean ॱ = ॱ(i, i2, 0, 0);
        if (!(ॱ || this.ˎ != 0 || this.ॱˋ == null)) {
            this.ॱˋ = null;
        }
        return ॱ;
    }

    public boolean ˋ(int i, int i2) {
        if (this.ʻॱ) {
            return ॱ(i, i2, (int) this.ˏॱ.getXVelocity(this.ˋ), (int) this.ˏॱ.getYVelocity(this.ˋ));
        }
        throw new IllegalStateException("Cannot settleCapturedViewAt outside of a call to Callback#onViewReleased");
    }

    private boolean ॱ(int i, int i2, int i3, int i4) {
        int left = this.ॱˋ.getLeft();
        int top = this.ॱˋ.getTop();
        int i5 = i - left;
        int i6 = i2 - top;
        if (i5 == 0 && i6 == 0) {
            this.ॱᐝ.abortAnimation();
            ˏ(0);
            return false;
        }
        this.ॱᐝ.startScroll(left, top, i5, i6, ˊ(this.ॱˋ, i5, i6, i3, i4));
        ˏ(2);
        return true;
    }

    private int ˊ(View view, int i, int i2, int i3, int i4) {
        int ˊ = ˊ(i3, (int) this.ॱˊ, (int) this.ˊॱ);
        int ˊ2 = ˊ(i4, (int) this.ॱˊ, (int) this.ˊॱ);
        int abs = Math.abs(i);
        int abs2 = Math.abs(i2);
        int abs3 = Math.abs(ˊ);
        int abs4 = Math.abs(ˊ2);
        int i5 = abs3 + abs4;
        int i6 = abs + abs2;
        return (int) (((ˊ2 != 0 ? ((float) abs4) / ((float) i5) : ((float) abs2) / ((float) i6)) * ((float) ˎ(i2, ˊ2, this.ॱˎ.ˎ(view)))) + ((ˊ != 0 ? ((float) abs3) / ((float) i5) : ((float) abs) / ((float) i6)) * ((float) ˎ(i, ˊ, this.ॱˎ.ˊ(view)))));
    }

    private int ˎ(int i, int i2, int i3) {
        if (i == 0) {
            return 0;
        }
        int width = this.ʾ.getWidth();
        int i4 = width / 2;
        float ˎ = (ˎ(Math.min(1.0f, ((float) Math.abs(i)) / ((float) width))) * ((float) i4)) + ((float) i4);
        i4 = Math.abs(i2);
        if (i4 > 0) {
            width = Math.round(Math.abs(ˎ / ((float) i4)) * 1000.0f) * 4;
        } else {
            width = (int) (((((float) Math.abs(i)) / ((float) i3)) + 1.0f) * 256.0f);
        }
        return Math.min(width, 600);
    }

    private int ˊ(int i, int i2, int i3) {
        int abs = Math.abs(i);
        if (abs < i2) {
            return 0;
        }
        if (abs <= i3) {
            return i;
        }
        if (i <= 0) {
            return -i3;
        }
        return i3;
    }

    private float ˎ(float f, float f2, float f3) {
        float abs = Math.abs(f);
        if (abs < f2) {
            return 0.0f;
        }
        if (abs <= f3) {
            return f;
        }
        if (f <= 0.0f) {
            return -f3;
        }
        return f3;
    }

    private float ˎ(float f) {
        return (float) Math.sin((double) ((f - 0.5f) * 0.47123894f));
    }

    public boolean ˋ(boolean z) {
        if (this.ˎ == 2) {
            int i;
            boolean computeScrollOffset = this.ॱᐝ.computeScrollOffset();
            int currX = this.ॱᐝ.getCurrX();
            int currY = this.ॱᐝ.getCurrY();
            int left = currX - this.ॱˋ.getLeft();
            int top = currY - this.ॱˋ.getTop();
            if (left != 0) {
                ViewCompat.ॱॱ(this.ॱˋ, left);
            }
            if (top != 0) {
                ViewCompat.ʽ(this.ॱˋ, top);
            }
            if (!(left == 0 && top == 0)) {
                this.ॱˎ.ॱ(this.ॱˋ, currX, currY, left, top);
            }
            if (computeScrollOffset && currX == this.ॱᐝ.getFinalX() && currY == this.ॱᐝ.getFinalY()) {
                this.ॱᐝ.abortAnimation();
                i = 0;
            } else {
                boolean z2 = computeScrollOffset;
            }
            if (i == 0) {
                if (z) {
                    this.ʾ.post(this.ʼॱ);
                } else {
                    ˏ(0);
                }
            }
        }
        return this.ˎ == 2;
    }

    private void ˊ(float f, float f2) {
        this.ʻॱ = true;
        this.ॱˎ.ˎ(this.ॱˋ, f, f2);
        this.ʻॱ = false;
        if (this.ˎ == 1) {
            ˏ(0);
        }
    }

    private void ᐝ() {
        if (this.ॱ != null) {
            Arrays.fill(this.ॱ, 0.0f);
            Arrays.fill(this.ˊ, 0.0f);
            Arrays.fill(this.ᐝ, 0.0f);
            Arrays.fill(this.ʽ, 0.0f);
            Arrays.fill(this.ʼ, 0);
            Arrays.fill(this.ʻ, 0);
            Arrays.fill(this.ॱॱ, 0);
            this.ͺ = 0;
        }
    }

    private void ॱ(int i) {
        if (this.ॱ != null && ˊ(i)) {
            this.ॱ[i] = 0.0f;
            this.ˊ[i] = 0.0f;
            this.ᐝ[i] = 0.0f;
            this.ʽ[i] = 0.0f;
            this.ʼ[i] = 0;
            this.ʻ[i] = 0;
            this.ॱॱ[i] = 0;
            this.ͺ &= (1 << i) ^ -1;
        }
    }

    private void ʽ(int i) {
        if (this.ॱ == null || this.ॱ.length <= i) {
            Object obj = new float[(i + 1)];
            Object obj2 = new float[(i + 1)];
            Object obj3 = new float[(i + 1)];
            Object obj4 = new float[(i + 1)];
            Object obj5 = new int[(i + 1)];
            Object obj6 = new int[(i + 1)];
            Object obj7 = new int[(i + 1)];
            if (this.ॱ != null) {
                System.arraycopy(this.ॱ, 0, obj, 0, this.ॱ.length);
                System.arraycopy(this.ˊ, 0, obj2, 0, this.ˊ.length);
                System.arraycopy(this.ᐝ, 0, obj3, 0, this.ᐝ.length);
                System.arraycopy(this.ʽ, 0, obj4, 0, this.ʽ.length);
                System.arraycopy(this.ʼ, 0, obj5, 0, this.ʼ.length);
                System.arraycopy(this.ʻ, 0, obj6, 0, this.ʻ.length);
                System.arraycopy(this.ॱॱ, 0, obj7, 0, this.ॱॱ.length);
            }
            this.ॱ = obj;
            this.ˊ = obj2;
            this.ᐝ = obj3;
            this.ʽ = obj4;
            this.ʼ = obj5;
            this.ʻ = obj6;
            this.ॱॱ = obj7;
        }
    }

    private void ˊ(float f, float f2, int i) {
        ʽ(i);
        float[] fArr = this.ॱ;
        this.ᐝ[i] = f;
        fArr[i] = f;
        fArr = this.ˊ;
        this.ʽ[i] = f2;
        fArr[i] = f2;
        this.ʼ[i] = ˏ((int) f, (int) f2);
        this.ͺ |= 1 << i;
    }

    private void ˊ(MotionEvent motionEvent) {
        int pointerCount = motionEvent.getPointerCount();
        for (int i = 0; i < pointerCount; i++) {
            int pointerId = motionEvent.getPointerId(i);
            if (ʻ(pointerId)) {
                float x = motionEvent.getX(i);
                float y = motionEvent.getY(i);
                this.ᐝ[pointerId] = x;
                this.ʽ[pointerId] = y;
            }
        }
    }

    public boolean ˊ(int i) {
        return (this.ͺ & (1 << i)) != 0;
    }

    void ˏ(int i) {
        this.ʾ.removeCallbacks(this.ʼॱ);
        if (this.ˎ != i) {
            this.ˎ = i;
            this.ॱˎ.ˏ(i);
            if (this.ˎ == 0) {
                this.ॱˋ = null;
            }
        }
    }

    boolean ˊ(View view, int i) {
        if (view == this.ॱˋ && this.ˋ == i) {
            return true;
        }
        if (view == null || !this.ॱˎ.ˏ(view, i)) {
            return false;
        }
        this.ˋ = i;
        ॱ(view, i);
        return true;
    }

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public boolean ˏ(@androidx.annotation.NonNull android.view.MotionEvent r14) {
        /*
        r13 = this;
        r0 = r14.getActionMasked();
        r1 = r14.getActionIndex();
        if (r0 != 0) goto L_0x000d;
    L_0x000a:
        r13.ˋ();
    L_0x000d:
        r2 = r13.ˏॱ;
        if (r2 != 0) goto L_0x0017;
    L_0x0011:
        r2 = android.view.VelocityTracker.obtain();
        r13.ˏॱ = r2;
    L_0x0017:
        r2 = r13.ˏॱ;
        r2.addMovement(r14);
        switch(r0) {
            case 0: goto L_0x0026;
            case 1: goto L_0x0128;
            case 2: goto L_0x0092;
            case 3: goto L_0x0128;
            case 4: goto L_0x001f;
            case 5: goto L_0x005a;
            case 6: goto L_0x011f;
            default: goto L_0x001f;
        };
    L_0x001f:
        r0 = r13.ˎ;
        r1 = 1;
        if (r0 != r1) goto L_0x012d;
    L_0x0024:
        r0 = 1;
    L_0x0025:
        return r0;
    L_0x0026:
        r0 = r14.getX();
        r1 = r14.getY();
        r2 = 0;
        r2 = r14.getPointerId(r2);
        r13.ˊ(r0, r1, r2);
        r0 = (int) r0;
        r1 = (int) r1;
        r0 = r13.ˎ(r0, r1);
        r1 = r13.ॱˋ;
        if (r0 != r1) goto L_0x0048;
    L_0x0040:
        r1 = r13.ˎ;
        r3 = 2;
        if (r1 != r3) goto L_0x0048;
    L_0x0045:
        r13.ˊ(r0, r2);
    L_0x0048:
        r0 = r13.ʼ;
        r0 = r0[r2];
        r1 = r13.ᐝॱ;
        r1 = r1 & r0;
        if (r1 == 0) goto L_0x001f;
    L_0x0051:
        r1 = r13.ॱˎ;
        r3 = r13.ᐝॱ;
        r0 = r0 & r3;
        r1.ˎ(r0, r2);
        goto L_0x001f;
    L_0x005a:
        r0 = r14.getPointerId(r1);
        r2 = r14.getX(r1);
        r1 = r14.getY(r1);
        r13.ˊ(r2, r1, r0);
        r3 = r13.ˎ;
        if (r3 != 0) goto L_0x007f;
    L_0x006d:
        r1 = r13.ʼ;
        r1 = r1[r0];
        r2 = r13.ᐝॱ;
        r2 = r2 & r1;
        if (r2 == 0) goto L_0x001f;
    L_0x0076:
        r2 = r13.ॱˎ;
        r3 = r13.ᐝॱ;
        r1 = r1 & r3;
        r2.ˎ(r1, r0);
        goto L_0x001f;
    L_0x007f:
        r3 = r13.ˎ;
        r4 = 2;
        if (r3 != r4) goto L_0x001f;
    L_0x0084:
        r2 = (int) r2;
        r1 = (int) r1;
        r1 = r13.ˎ(r2, r1);
        r2 = r13.ॱˋ;
        if (r1 != r2) goto L_0x001f;
    L_0x008e:
        r13.ˊ(r1, r0);
        goto L_0x001f;
    L_0x0092:
        r0 = r13.ॱ;
        if (r0 == 0) goto L_0x001f;
    L_0x0096:
        r0 = r13.ˊ;
        if (r0 == 0) goto L_0x001f;
    L_0x009a:
        r2 = r14.getPointerCount();
        r0 = 0;
        r1 = r0;
    L_0x00a0:
        if (r1 >= r2) goto L_0x0107;
    L_0x00a2:
        r3 = r14.getPointerId(r1);
        r0 = r13.ʻ(r3);
        if (r0 != 0) goto L_0x00b0;
    L_0x00ac:
        r0 = r1 + 1;
        r1 = r0;
        goto L_0x00a0;
    L_0x00b0:
        r0 = r14.getX(r1);
        r4 = r14.getY(r1);
        r5 = r13.ॱ;
        r5 = r5[r3];
        r5 = r0 - r5;
        r6 = r13.ˊ;
        r6 = r6[r3];
        r6 = r4 - r6;
        r0 = (int) r0;
        r4 = (int) r4;
        r4 = r13.ˎ(r0, r4);
        if (r4 == 0) goto L_0x010c;
    L_0x00cc:
        r0 = r13.ॱ(r4, r5, r6);
        if (r0 == 0) goto L_0x010c;
    L_0x00d2:
        r0 = 1;
    L_0x00d3:
        if (r0 == 0) goto L_0x010e;
    L_0x00d5:
        r7 = r4.getLeft();
        r8 = (int) r5;
        r8 = r8 + r7;
        r9 = r13.ॱˎ;
        r10 = (int) r5;
        r8 = r9.ˎ(r4, r8, r10);
        r9 = r4.getTop();
        r10 = (int) r6;
        r10 = r10 + r9;
        r11 = r13.ॱˎ;
        r12 = (int) r6;
        r10 = r11.ˋ(r4, r10, r12);
        r11 = r13.ॱˎ;
        r11 = r11.ˊ(r4);
        r12 = r13.ॱˎ;
        r12 = r12.ˎ(r4);
        if (r11 == 0) goto L_0x0101;
    L_0x00fd:
        if (r11 <= 0) goto L_0x010e;
    L_0x00ff:
        if (r8 != r7) goto L_0x010e;
    L_0x0101:
        if (r12 == 0) goto L_0x0107;
    L_0x0103:
        if (r12 <= 0) goto L_0x010e;
    L_0x0105:
        if (r10 != r9) goto L_0x010e;
    L_0x0107:
        r13.ˊ(r14);
        goto L_0x001f;
    L_0x010c:
        r0 = 0;
        goto L_0x00d3;
    L_0x010e:
        r13.ˏ(r5, r6, r3);
        r5 = r13.ˎ;
        r6 = 1;
        if (r5 == r6) goto L_0x0107;
    L_0x0116:
        if (r0 == 0) goto L_0x00ac;
    L_0x0118:
        r0 = r13.ˊ(r4, r3);
        if (r0 == 0) goto L_0x00ac;
    L_0x011e:
        goto L_0x0107;
    L_0x011f:
        r0 = r14.getPointerId(r1);
        r13.ॱ(r0);
        goto L_0x001f;
    L_0x0128:
        r13.ˋ();
        goto L_0x001f;
    L_0x012d:
        r0 = 0;
        goto L_0x0025;
        */
        throw new UnsupportedOperationException("Method not decompiled: o.jf.ˏ(android.view.MotionEvent):boolean");
    }

    public void ˋ(@NonNull MotionEvent motionEvent) {
        int i = 0;
        int actionMasked = motionEvent.getActionMasked();
        int actionIndex = motionEvent.getActionIndex();
        if (actionMasked == 0) {
            ˋ();
        }
        if (this.ˏॱ == null) {
            this.ˏॱ = VelocityTracker.obtain();
        }
        this.ˏॱ.addMovement(motionEvent);
        float x;
        float y;
        View ˎ;
        int i2;
        switch (actionMasked) {
            case 0:
                x = motionEvent.getX();
                y = motionEvent.getY();
                i = motionEvent.getPointerId(0);
                ˎ = ˎ((int) x, (int) y);
                ˊ(x, y, i);
                ˊ(ˎ, i);
                i2 = this.ʼ[i];
                if ((this.ᐝॱ & i2) != 0) {
                    this.ॱˎ.ˎ(i2 & this.ᐝॱ, i);
                    return;
                }
                return;
            case 1:
                if (this.ˎ == 1) {
                    ʽ();
                }
                ˋ();
                return;
            case 2:
                if (this.ˎ != 1) {
                    i2 = motionEvent.getPointerCount();
                    while (i < i2) {
                        actionMasked = motionEvent.getPointerId(i);
                        if (ʻ(actionMasked)) {
                            float x2 = motionEvent.getX(i);
                            float y2 = motionEvent.getY(i);
                            float f = x2 - this.ॱ[actionMasked];
                            float f2 = y2 - this.ˊ[actionMasked];
                            ˏ(f, f2, actionMasked);
                            if (this.ˎ != 1) {
                                ˎ = ˎ((int) x2, (int) y2);
                                if (ॱ(ˎ, f, f2) && ˊ(ˎ, actionMasked)) {
                                }
                            }
                            ˊ(motionEvent);
                            return;
                        }
                        i++;
                    }
                    ˊ(motionEvent);
                    return;
                } else if (ʻ(this.ˋ)) {
                    i = motionEvent.findPointerIndex(this.ˋ);
                    x = motionEvent.getX(i);
                    i2 = (int) (x - this.ᐝ[this.ˋ]);
                    i = (int) (motionEvent.getY(i) - this.ʽ[this.ˋ]);
                    ˋ(this.ॱˋ.getLeft() + i2, this.ॱˋ.getTop() + i, i2, i);
                    ˊ(motionEvent);
                    return;
                } else {
                    return;
                }
            case 3:
                if (this.ˎ == 1) {
                    ˊ(0.0f, 0.0f);
                }
                ˋ();
                return;
            case 5:
                i = motionEvent.getPointerId(actionIndex);
                x = motionEvent.getX(actionIndex);
                y = motionEvent.getY(actionIndex);
                ˊ(x, y, i);
                if (this.ˎ == 0) {
                    ˊ(ˎ((int) x, (int) y), i);
                    i2 = this.ʼ[i];
                    if ((this.ᐝॱ & i2) != 0) {
                        this.ॱˎ.ˎ(i2 & this.ᐝॱ, i);
                        return;
                    }
                    return;
                } else if (ˊ((int) x, (int) y)) {
                    ˊ(this.ॱˋ, i);
                    return;
                } else {
                    return;
                }
            case 6:
                actionMasked = motionEvent.getPointerId(actionIndex);
                if (this.ˎ == 1 && actionMasked == this.ˋ) {
                    actionIndex = motionEvent.getPointerCount();
                    while (i < actionIndex) {
                        int pointerId = motionEvent.getPointerId(i);
                        if (pointerId != this.ˋ) {
                            if (ˎ((int) motionEvent.getX(i), (int) motionEvent.getY(i)) == this.ॱˋ && ˊ(this.ॱˋ, pointerId)) {
                                i = this.ˋ;
                                if (i == -1) {
                                    ʽ();
                                }
                            }
                        }
                        i++;
                    }
                    i = -1;
                    if (i == -1) {
                        ʽ();
                    }
                }
                ॱ(actionMasked);
                return;
            default:
                return;
        }
    }

    private void ˏ(float f, float f2, int i) {
        int i2 = 1;
        if (!ˎ(f, f2, i, 1)) {
            i2 = 0;
        }
        if (ˎ(f2, f, i, 4)) {
            i2 |= 4;
        }
        if (ˎ(f, f2, i, 2)) {
            i2 |= 2;
        }
        if (ˎ(f2, f, i, 8)) {
            i2 |= 8;
        }
        if (i2 != 0) {
            int[] iArr = this.ʻ;
            iArr[i] = iArr[i] | i2;
            this.ॱˎ.ˏ(i2, i);
        }
    }

    private boolean ˎ(float f, float f2, int i, int i2) {
        float abs = Math.abs(f);
        float abs2 = Math.abs(f2);
        if ((this.ʼ[i] & i2) != i2 || (this.ᐝॱ & i2) == 0 || (this.ॱॱ[i] & i2) == i2 || (this.ʻ[i] & i2) == i2) {
            return false;
        }
        if (abs <= ((float) this.ˏ) && abs2 <= ((float) this.ˏ)) {
            return false;
        }
        if (abs < abs2 * 0.5f && this.ॱˎ.ˋ(i2)) {
            int[] iArr = this.ॱॱ;
            iArr[i] = iArr[i] | i2;
            return false;
        } else if ((this.ʻ[i] & i2) != 0 || abs <= ((float) this.ˏ)) {
            return false;
        } else {
            return true;
        }
    }

    private boolean ॱ(View view, float f, float f2) {
        if (view == null) {
            return false;
        }
        boolean z;
        boolean z2;
        if (this.ॱˎ.ˊ(view) > 0) {
            z = true;
        } else {
            z = false;
        }
        if (this.ॱˎ.ˎ(view) > 0) {
            z2 = true;
        } else {
            z2 = false;
        }
        if (z && z2) {
            if ((f * f) + (f2 * f2) <= ((float) (this.ˏ * this.ˏ))) {
                return false;
            }
            return true;
        } else if (z) {
            if (Math.abs(f) <= ((float) this.ˏ)) {
                return false;
            }
            return true;
        } else if (!z2) {
            return false;
        } else {
            if (Math.abs(f2) <= ((float) this.ˏ)) {
                return false;
            }
            return true;
        }
    }

    public boolean ˎ(int i) {
        int length = this.ॱ.length;
        for (int i2 = 0; i2 < length; i2++) {
            if (ॱ(i, i2)) {
                return true;
            }
        }
        return false;
    }

    public boolean ॱ(int i, int i2) {
        if (!ˊ(i2)) {
            return false;
        }
        boolean z;
        boolean z2 = (i & 1) == 1;
        if ((i & 2) == 2) {
            z = true;
        } else {
            z = false;
        }
        float f = this.ᐝ[i2] - this.ॱ[i2];
        float f2 = this.ʽ[i2] - this.ˊ[i2];
        if (z2 && z) {
            if ((f * f) + (f2 * f2) <= ((float) (this.ˏ * this.ˏ))) {
                return false;
            }
            return true;
        } else if (z2) {
            if (Math.abs(f) <= ((float) this.ˏ)) {
                return false;
            }
            return true;
        } else if (!z) {
            return false;
        } else {
            if (Math.abs(f2) <= ((float) this.ˏ)) {
                return false;
            }
            return true;
        }
    }

    private void ʽ() {
        this.ˏॱ.computeCurrentVelocity(1000, this.ˊॱ);
        ˊ(ˎ(this.ˏॱ.getXVelocity(this.ˋ), this.ॱˊ, this.ˊॱ), ˎ(this.ˏॱ.getYVelocity(this.ˋ), this.ॱˊ, this.ˊॱ));
    }

    private void ˋ(int i, int i2, int i3, int i4) {
        int ˎ;
        int ˋ;
        int left = this.ॱˋ.getLeft();
        int top = this.ॱˋ.getTop();
        if (i3 != 0) {
            ˎ = this.ॱˎ.ˎ(this.ॱˋ, i, i3);
            ViewCompat.ॱॱ(this.ॱˋ, ˎ - left);
        } else {
            ˎ = i;
        }
        if (i4 != 0) {
            ˋ = this.ॱˎ.ˋ(this.ॱˋ, i2, i4);
            ViewCompat.ʽ(this.ॱˋ, ˋ - top);
        } else {
            ˋ = i2;
        }
        if (i3 != 0 || i4 != 0) {
            this.ॱˎ.ॱ(this.ॱˋ, ˎ, ˋ, ˎ - left, ˋ - top);
        }
    }

    public boolean ˊ(int i, int i2) {
        return ˊ(this.ॱˋ, i, i2);
    }

    public boolean ˊ(@Nullable View view, int i, int i2) {
        if (view != null && i >= view.getLeft() && i < view.getRight() && i2 >= view.getTop() && i2 < view.getBottom()) {
            return true;
        }
        return false;
    }

    @Nullable
    public View ˎ(int i, int i2) {
        for (int childCount = this.ʾ.getChildCount() - 1; childCount >= 0; childCount--) {
            View childAt = this.ʾ.getChildAt(this.ॱˎ.ॱ(childCount));
            if (i >= childAt.getLeft() && i < childAt.getRight() && i2 >= childAt.getTop() && i2 < childAt.getBottom()) {
                return childAt;
            }
        }
        return null;
    }

    private int ˏ(int i, int i2) {
        int i3 = 0;
        if (i < this.ʾ.getLeft() + this.ˋॱ) {
            i3 = 1;
        }
        if (i2 < this.ʾ.getTop() + this.ˋॱ) {
            i3 |= 4;
        }
        if (i > this.ʾ.getRight() - this.ˋॱ) {
            i3 |= 2;
        }
        if (i2 > this.ʾ.getBottom() - this.ˋॱ) {
            return i3 | 8;
        }
        return i3;
    }

    private boolean ʻ(int i) {
        if (ˊ(i)) {
            return true;
        }
        Log.e("ViewDragHelper", "Ignoring pointerId=" + i + " because ACTION_DOWN was not received " + "for this pointer before ACTION_MOVE. It likely happened because " + " ViewDragHelper did not receive all the events in the event stream.");
        return false;
    }
}
